#ifndef COLLISIONDETECTION_H
#define COLLISIONDETECTION_H

#include <ClanLib/core.h>
#include <ClanLib/display.h>
//#define SHOW_OUTLINES

class CollisionDetection{
private:
	static CollisionDetection* instanz;
	CL_PixelBuffer collision;
	CL_CollisionOutline* outline;
	CL_CollisionOutline* ladders;
	CL_Vec2<int> mario;
protected:
	CollisionDetection();
public:
	static CollisionDetection* giveme();
	~CollisionDetection();
	bool gravity (CL_Vec2<int> position);
	bool border(int x);
	bool atLadder(CL_Vec2<int> position);
	bool enofstate(CL_Vec2<int> endpoint, CL_Vec2<int> position);
	bool mariobarrel(CL_Vec2<int> barrel);
	bool mariooverbarrel(CL_Vec2<int> barrel);
	void setmario(CL_Vec2<int> mariopos);
	bool win();
#ifdef SHOW_OUTLINES
	void drawLadders(CL_GraphicContext context);
	void drawOutline(CL_GraphicContext context);
#endif
};

#endif